function co(fn) {
    let gen = fn()
    function next(params) {
        let { value, done } = gen.next(params)
        if (done) return value
        if (value.then) {
            value.then(res => next(res))
        } else {
            next(value)
        }
    }
    next()
}






































